/*
 * Copyright (c) 2025 Li Auto Inc. and its affiliates
 * Licensed under the Apache License, Version 2.0(the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *     http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */

/*
 * Description: Memmap Section Configuration
 * AutoGenerate Code, DO NOT EDIT!!!
 * {{get_generation_time()}}
 * {{get_project_name()}}
 * {{get_vcos_version()}}
 */

#ifndef APPS_APP_CFG_COMPILER_H
#define APPS_APP_CFG_COMPILER_H

#ifdef __cplusplus
extern "C"
{
#endif

/* Including File */

/* global Macro Definition */

/* Local Section Definition */

/* global Section Definition */

/*---------------------------global Text--------------------------------*/
#define OS_CODE_SECTION  .text

/*---------------------------global Rodata--------------------------------*/
#define OS_CONST_SECTION  .rodata

/*---------------------------global Variable-----------------------*/
#define OS_GLOBAL_VAR_NO_INIT_SECTION  .bss
#define OS_GLOBAL_VAR_INIT_SECTION  .data

/*------------------------Core Shared Varibles-----------------------*/
{%- set core_cfg = get_core_configs() %}
{%- for core_val in core_cfg.values() %}
#define OS_CORE{{core_val["core_id"][-1].upper()}}_VAR_NO_INIT_SECTION  .bss.bss_cpu{{core_val["core_id"][-1].upper()}}.core_shared_var
#define OS_CORE{{core_val["core_id"][-1].upper()}}_VAR_INIT_SECTION  .data.data_cpu{{core_val["core_id"][-1].upper()}}.core_shared_var
{% endfor %}
/*------------------------APP Variables-----------------------*/
{%- set app_cfg = get_app_cfg() %}
{%- for app_key, app_val in app_cfg.items() %}
#define OS_{{app_key.upper()}}_VAR_NO_INIT_SECTION .bss.bss_cpu{{app_val["CoreNumber"]}}.app_var
#define OS_{{app_key.upper()}}_VAR_INIT_SECTION .data.data_cpu{{app_val["CoreNumber"]}}.app_var
{% endfor %}
/*------------------------task Variables-----------------------*/
{%- for app, app_val in app_cfg.items() %}
    {%- for task in app_val["AppTaskList"] %}
#define OS_{{task.upper()}}_VAR_NO_INIT_SECTION .bss.bss_cpu{{app_val["CoreNumber"]}}.task_var
#define OS_{{task.upper()}}_VAR_INIT_SECTION .data.data_cpu{{app_val["CoreNumber"]}}.task_var
    {% endfor %}
{%- endfor %}
/* global Enumeration Definition */

/* global type & Structure Definition */

/* global Function Declaration */

/* global Function Implementation */

#ifdef __cplusplus
}
#endif

#endif	 /* APPS_APP_CFG_COMPILER_H */

